fix(ts): export types explicitly - #14428
Conversation
Yury Semikhatsky (yury-s)
left a comment
There was a problem hiding this comment.
Please add a test for this.
900fdef to
ed88353
Compare
|
I won't need a test once we move to TS 4.7. We have the opposite problem though, we might need bots for earlier versions of TS. |
|
any chance for a bugfix release with this change? just noticed it didn't resolve types in native esm mode (node16 module/moduleResolution)... 😮 was going to report it using the following reproduction steps: |
|
Avi Vahl (@AviVahl) you can use the next version |
|
thanks for the tip. 👍 would be useful in own projects, but my team is using some dependencies with stable playwright peerDeps. I'm currently using |
Since the filename pointed at by `default` and `import` (`empty`) is not identical to the filename of the `d.ts` file (`index`), the top level `types` field is not enough when using `"moduleResolution":"Node16"` and TypeScript `4.7`. To fix this, `types` must be explicitly specified inside the `exports` object in addition to the top level `types` field. See [firebase/firebase-js-sdk#6300](/firebase/firebase-js-sdk/issues/6300) and [microsoft/playwright#14428](/microsoft/playwright/pull/14428)
Fixes #14348